Code extensions

Code extensions offer a more standardized way of Groovy usage, which makes them easier to use and upgrade because they are less prone to failure, easier to troubleshoot, and require less cleanup after an upgrade. Unlike Groovy plug-ins, code extensions are inherited in the application from the underlying framework layer. They are available in N4 version 2.0 and later.

Code extensions involve the following elements:

Code extensions can have a scope of Global through Facility. It is preferable to configure the code at the Operator level instead of at the Global level. Because the extension object itself is not associated with an entity, the scope for an extension is determined by the entities it is used for. At a given scope level, an extension name cannot be overridden; this means that you cannot have more than one extension named "myextension" at a given scope level. See also Scoped objects in N4 (on page 1).

When you save or update a code extension, it becomes active. To deactivate a code extension, you can do any of the following:

In general, when using code extensions, you should:

For more information on how to implement these code extension types, see Extension Type Registry view (on page 1). The Session Factory view provides information on the entities that are enabled for code extensions (Code Extensible column).

The code extensions feature uses standardized error handling to facilitate troubleshooting. Errors that occur inside a transaction cause a transaction rollback.

For information on the Java API, see the documentation provided under Help Java API Docs.

In some N4 versions, the link to this resource is not working. As a workaround, you can access the Java API docs directly from the N4 footprint installed on your server. From within the N4 application footprint, manually open the index.html file that is located at the following location (you should only see one of the following directory paths, not both):
Navis/sparcsn4/webapps/apex/argo/api/index.html
Navis/sparcsn4/webapps/apex/model/index.html

In this Section: